<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport"
			content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<title>搜索结果</title>
		<link rel="stylesheet" href="/mobile/layui/css/layui.css" />
		<link rel="stylesheet" href="/mobile/css/mobile.css" />
		<script src="/mobile/js/jquery.min.js"></script>
		<script src="/mobile/js/jquery.easing.min.js"></script>
		<script src="/mobile/layui/layui.js"></script>
		<style>
			.layui-tab-content {
			    padding:0;
			}
		</style>
	</head>
	<body>
		
		<div class="main" style="padding-bottom: 0;">
			<div class="search_container">
				<input type="search" class="search" placeholder="输入关键词..." value="{$keyword}" />
			</div>
		</div>
		
		<div class="layui-tab layui-tab-brief" >
		  <ul class="layui-tab-title" style="text-align: center;">

		    <li class="layui-this" style="margin: 0 50px;">企业</li>


		    <li style="margin: 0 50px;">产品</li>

		  </ul>
		  <div class="layui-tab-content">
		    <div class="layui-tab-item layui-show">
				<!--企业 -->
				<ul class="qiyelist">
					{volist name="rs_qiye" id="item" empty="$empty"}
					<a href="{:url('qiye/detail',['id'=>$item.id])}"><li>
						<div class="img" style="background-image: url({$item.image});"></div>
						<div class="content">
							<h3 class="title">{$item.name}</h3>
						</div>
					</li></a>
					{/volist}
				</ul>
			</div>
		    <div class="layui-tab-item">
				<!--产品 -->
				<ul class="goodslist">
					{volist name="rs_product" id="item" empty="$empty"}
					<a href="{:url('product/detail',['id'=>$item.id])}"><li class="chuangxin"><div class="img" style="background-image: url({$item.image});"></div>
						<div class="title">{$item.name}</div>
						<div class="desc">{$item.qiye_name}</div>
					</li></a>
					{/volist}
					
				</ul>

			</div>
		  </div>
		</div>
	</body>
<script type="text/javascript">

		$("input.search").keypress(function (e) {
		    	// 兼容写法
		      e = e || window.event;
		      key = e.keyCode || e.which || e.charCode;
		      if (key == 13) {
		          console.log($(this).val());
				  if($(this).val().trim()==''){
					  alert('请输入关键词');
					  return false;
				  }
				  window.open('{:url('xiangsu/search')}?keyword='+$(this).val(),'_blank')
		      }
		  });
	</script>	
</html>